/* 排行榜样式 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding-bottom: 40px;
}

/* 导航栏 */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-logo img {
    width: 40px;
    height: 40px;
}

.nav-logo h2 {
    font-size: 20px;
    color: #333;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-link {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-link:hover {
    color: #667eea;
}

.logout-btn {
    padding: 8px 20px;
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s;
}

.logout-btn:hover {
    background: #ff3838;
}

/* 主内容区 */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.leaderboard-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* 页面标题 */
.page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

.page-header h1 {
    font-size: 36px;
    margin-bottom: 10px;
}

.page-header p {
    font-size: 18px;
    opacity: 0.9;
}

/* 统计卡片 */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding: 30px;
    background: #f8f9fa;
}

.stat-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
}

.stat-icon .icon-pentagram {
    font-size: 46px;
    color: #fff;
}

.stat-icon .icon-data,
.stat-icon .icon-people,
.stat-icon .icon-star {
    font-size: 44px;
    color: #fff;
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.stat-label {
    color: #666;
    font-size: 14px;
}

/* 排行榜标签 */
.leaderboard-tabs {
    display: flex;
    background: #f5f5f5;
    border-bottom: 2px solid #e0e0e0;
}

.tab-btn {
    flex: 1;
    padding: 20px;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: white;
}

/* 排行榜列表 */
.leaderboard-list {
    padding: 30px;
}

.rank-item {
    display: flex;
    align-items: center;
    padding: 20px;
    margin-bottom: 15px;
    background: #f8f9fa;
    border-radius: 15px;
    transition: all 0.3s;
    border-left: 5px solid transparent;
}

.rank-item:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.rank-item.top-1 {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    border-left-color: #ffb800;
}

.rank-item.top-2 {
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
    border-left-color: #999;
}

.rank-item.top-3 {
    background: linear-gradient(135deg, #cd7f32 0%, #ffb366 100%);
    border-left-color: #b87333;
}

.rank-number {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    margin-right: 20px;
}

.rank-item.top-1 .rank-number,
.rank-item.top-2 .rank-number,
.rank-item.top-3 .rank-number {
    background: rgba(255, 255, 255, 0.9);
    font-size: 28px;
}

.rank-item.top-1 .rank-number,
.rank-item.top-2 .rank-number,
.rank-item.top-3 .rank-number {
    position: relative;
}

.rank-item.top-1 .rank-number {
    font-size: 0;
}

.rank-item.top-1 .rank-number::after {
    content: '🥇';
    font-size: 32px;
    display: block;
}

.rank-item.top-2 .rank-number {
    font-size: 0;
}

.rank-item.top-2 .rank-number::after {
    content: '🥈';
    font-size: 32px;
    display: block;
}

.rank-item.top-3 .rank-number {
    font-size: 0;
}

.rank-item.top-3 .rank-number::after {
    content: '🥉';
    font-size: 32px;
    display: block;
}

.user-info {
    flex: 1;
}

.user-name {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.user-email {
    font-size: 14px;
    color: #999;
}

.rank-stats {
    display: flex;
    gap: 30px;
    text-align: center;
}

.stat-item {
    min-width: 80px;
}

.stat-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
}

.loading,
.no-data {
    text-align: center;
    padding: 60px;
    color: #999;
    font-size: 18px;
}

/* 徽章 */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    margin-left: 10px;
}

.badge-gold {
    background: #ffd700;
    color: #333;
}

.badge-silver {
    background: #c0c0c0;
    color: #333;
}

.badge-bronze {
    background: #cd7f32;
    color: white;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 15px;
    }

    .nav-menu {
        width: 100%;
        justify-content: space-between;
    }

    .page-header h1 {
        font-size: 28px;
    }

    .page-header p {
        font-size: 16px;
    }

    .stats-overview {
        grid-template-columns: 1fr;
    }

    .leaderboard-tabs {
        flex-direction: column;
    }

    .tab-btn {
        border-bottom: none;
        border-right: 3px solid transparent;
    }

    .tab-btn.active {
        border-right-color: #667eea;
        border-bottom-color: transparent;
    }

    .rank-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .rank-stats {
        width: 100%;
        justify-content: space-around;
        margin-top: 15px;
    }

    .user-info {
        margin-left: 0;
    }
}

